﻿namespace SSISComponents
{
    public class Column
    {

        private string strName;
        private Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType dtDataType;
        private int intLength;
        private int intPrecision;
        private int intScale;
        private int intCodepage;
        private string strDescription = null;
        private int intLineageID = 0;
        private bool bRemove = false;

        /// <summary>
        /// Gets or sets the name of the column
        /// </summary>
        public string Name
        {
            get { return strName; }
            set { strName = value; }
        }

        /// <summary>
        /// Gets or sets the DataType of the column
        /// </summary>
        public Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType DataType
        {
            get { return dtDataType; }
            set { dtDataType = value; }
        }

        /// <summary>
        /// Gets or sets the length of the column
        /// </summary>
        public int Length
        {
            get { return intLength; }
            set { intLength = value; }
        }

        /// <summary>
        /// Gets or sets the precision of the column
        /// </summary>
        public int Precision
        {
            get { return intPrecision; }
            set { intPrecision = value; }
        }

        /// <summary>
        /// Gets or sets the scale of the column
        /// </summary>
        public int Scale
        {
            get { return intScale; }
            set { intScale = value; }
        }

        /// <summary>
        /// Gets or sets the codepage of the column
        /// </summary>
        public int Codepage
        {
            get { return intCodepage; }
            set { intCodepage = value; }
        }

        /// <summary>
        /// Gets or sets the lineageid of the column
        /// </summary>
        public int LineageID
        {
            get { return intLineageID; }
            set { intLineageID = value; }
        }

        public bool Remove
        {
            get { return bRemove; }
            set { bRemove = value; }
        }

        /// <summary>
        /// Gets or sets the description of the column
        /// </summary>
        public string Description
        {
            get
            {
                if (string.IsNullOrEmpty(strDescription))
                {
                    return strName;
                }
                else
                {
                    return strDescription;
                }
            }
            set { strDescription = value; }
        }

    }
}
